﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.ServiceModel;
using System.ServiceModel.Web;
using System.Web;
using DHQGHN.DAL.Models.DanhMuc;

namespace DHQGHN.Services
{
    // NOTE: You can use the "Rename" command on the "Refactor" menu to change the interface name "IAdminUnitExtraService" in both code and config file together.
    [ServiceContract]
    public interface IAdminUnitService
    {
        /// <summary>
        /// phunx1, 20150513: load danh sach hanh chinh mo rong theo ID
        /// </summary>
        /// <param name="adminUnitExtraID"></param>
        /// <returns></returns>
        [OperationContract]
        [WebGet(ResponseFormat = WebMessageFormat.Json,
            BodyStyle = WebMessageBodyStyle.Bare,
            UriTemplate = "GetByID/{adminUnitExtraID}"
            )]
        DAL.Models.DanhMuc.AdministrativeUnit GetByID(string adminUnitExtraID);

        /// <summary>
        /// phunx1, 20150513: load danh sach hanh chinh mo rong theo ID
        /// </summary>
        /// <param name="adminUnitExtraID"></param>
        /// <returns></returns>
        [OperationContract]
        [WebGet(ResponseFormat = WebMessageFormat.Json,
            BodyStyle = WebMessageBodyStyle.Bare,
            UriTemplate = "GetNewListsTablet/{lastUpdated}"
            )]
        AdministrativeUnitTablet GetNewListsTablet(string lastUpdated);

        /// <summary>
        /// 
        /// </summary>
        /// <param name="listName"></param>
        /// <param name="pageSize"></param>
        /// <param name="pageIdx"></param>
        /// <returns></returns>
        [OperationContract]
        [WebGet(ResponseFormat = WebMessageFormat.Json,
            BodyStyle = WebMessageBodyStyle.Bare,
            UriTemplate = "GetNewPagingTablet/{lastUpdated}/{pageSize}/{pageIndex}"
            )]
        AdministrativeUnitTablet GetNewPagingTablet(string lastUpdated, string pageSize, string pageIndex);

        /// <summary>
        /// nguoi tao: tribh
        /// ngay tao: 26.05.2015
        /// Muc dich: Get list AdministrativeUnit child
        /// </summary>
        /// <param name="code"></param>
        /// <param name="levels"></param>
        /// <returns></returns>
        [OperationContract]
        [WebGet(ResponseFormat = WebMessageFormat.Json,
            BodyStyle = WebMessageBodyStyle.Bare,
            UriTemplate = "GetByIdParentTablet/{code}/{levels}"
            )]
        List<AdministrativeUnit> GetByIdParentTablet(string code,string levels);

        /// <summary>
        /// nguoi tao: namdt
        /// ngay tao: 09.06.2015
        /// Muc dich: Get list AdministrativeUnit by P_CODE
        /// </summary>
        /// <param name="code"></param>
        /// <param name="levels"></param>
        /// <returns></returns>
        [OperationContract]
        [WebGet(ResponseFormat = WebMessageFormat.Json,
            BodyStyle = WebMessageBodyStyle.Bare,
            UriTemplate = "GetByPCODE/{pcode}"
            )]
        List<AdministrativeUnit> GetByPCODE(string pcode);

        [OperationContract]
        [WebInvoke(Method = "POST",
            ResponseFormat = WebMessageFormat.Json,
            RequestFormat = WebMessageFormat.Json,
            UriTemplate = "GetByCode")]
        List<ThongKeDS> GetByCode(ModelAreaListThongKe adm);
    }
}
